﻿<%@ Page Title="Đơn xin nghỉ phép | VNT Việt Nam" Language="C#" MasterPageFile="~/Admin.master"
    AutoEventWireup="true" CodeFile="NghiPhep.aspx.cs" Inherits="NghiPhep" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="up1" runat="server">
        <ContentTemplate>
            <div class="panel panel-success margin">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        Đơn xin nghỉ phép</h3>
                </div>
                <div class="panel-body">
                    <table width="100%">
                        <tr>
                            <td>
                                <span style="margin-left: 5px;">Số</span><br />
                                <asp:TextBox ID="txtSo" ReadOnly="true" runat="server" CssClass="form-control withall"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span style="margin-left: 5px;">Số ngày nghỉ phép</span><br />
                                <asp:TextBox ID="txtSoNgayNghi" AutoPostBack="true" runat="server" CssClass="form-control withall"
                                    OnTextChanged="txtSoNgayNghi_TextChanged"></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator1" runat="server"
                                    ControlToValidate="txtSoNgayNghi" ErrorMessage="Nhập số ngày nghỉ" Display="None"
                                    Text="*"></asp:RequiredFieldValidator>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server" FilterType="Numbers"
                                    TargetControlID="txtSoNgayNghi" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span style="margin-left: 5px;">Từ ngày</span><br />
                                <asp:TextBox ID="txtTuNgay" AutoPostBack="true" OnTextChanged="txtSoNgayNghi_TextChanged"
                                    runat="server" CssClass="form-control withall"></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator2" runat="server"
                                    ControlToValidate="txtTuNgay" ErrorMessage="Nhập ngày bắt đầu nghỉ" Display="None"
                                    Text="*"></asp:RequiredFieldValidator>
                                <cc1:CalendarExtender ID="CalendarExtender1" PopupPosition="BottomLeft" runat="server"
                                    TargetControlID="txtTuNgay" Format="dd/MM/yyyy">
                                </cc1:CalendarExtender>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtTuNgay" ValidChars="/-" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span style="margin-left: 5px;">Đến ngày</span><br />
                                <asp:TextBox ID="txtDenNgay" ReadOnly="true" runat="server" CssClass="form-control withall"></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator3" runat="server"
                                    ControlToValidate="txtDenNgay" ErrorMessage="Nhập ngày kết thúc nghỉ" Display="None"
                                    Text="*"></asp:RequiredFieldValidator>
                                <cc1:CalendarExtender ID="CalendarExtender2" PopupPosition="BottomLeft" runat="server"
                                    TargetControlID="txtDenNgay" Format="dd/MM/yyyy">
                                </cc1:CalendarExtender>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender4" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtDenNgay" ValidChars="/-" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span style="margin-left: 5px;">Lý do xin nghỉ</span><br />
                                <asp:TextBox ID="txtLyDo" TextMode="MultiLine" Height="100px" runat="server" CssClass="form-control withall"></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator4" runat="server"
                                    ControlToValidate="txtLyDo" ErrorMessage="Nhập lý do nghỉ" Display="None" Text="*"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span style="margin-left: 5px;">Năm tính nghỉ phép</span><br />
                                <asp:TextBox ID="txtNamNghiPhep" runat="server" CssClass="form-control withall"></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator5" runat="server"
                                    ControlToValidate="txtNamNghiPhep" ErrorMessage="Nhập năm tính nghỉ phép" Display="None"
                                    Text="*"></asp:RequiredFieldValidator>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" FilterType="Numbers"
                                    TargetControlID="txtNamNghiPhep" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Button ID="btnSave" ValidationGroup="Them" runat="server" Style="margin-left: 5px;"
                                    Text="Nộp đơn" CssClass="btn btn-primary" OnClick="btnSave_Click" />
                                <asp:Button ID="btncapnhat" runat="server" Text="Cập nhật" CssClass="btn btn-info"
                                    OnClick="btncapnhat_Click" Visible="false" />
                                    <asp:Button ID="btnXoa" runat="server" Text="Xóa đơn" CssClass="btn btn-primary"
                                    OnClick="btnXoa_Click" Visible="false" />
                                <asp:Button ID="btnCancel" runat="server" Text="Viết đơn mới" CssClass="btn btn-warning"
                                    OnClick="btnCancel_Click" />
                                <asp:Button ID="btnPDF" runat="server" Text="Xuất PDF" CssClass="btn btn-info" OnClick="btnPDF_Click" />
                                <asp:Button ID="btnDuyet" runat="server" Text="Phê duyệt" CssClass="btn btn-danger" />
                            </td>
                        </tr>
                    </table>
                    <asp:ValidationSummary ID="ValidationSummary1" HeaderText="Bạn phải nhập các trường sau:"
                        ShowMessageBox="true" ValidationGroup="Them" ShowSummary="false" EnableClientScript="true"
                        runat="server" />
                </div>
            </div>
            <div style="margin: 5px;">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <b>Danh sách nghỉ phép</b>
                    </div>
                    <div style="width: 100%; margin-top: 0px;" class="wrapper">
                        <asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" BackColor="White"
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="1" EmptyDataText="Không có dữ liệu nào"
                            EnableModelValidation="True" ShowFooter="false" CssClass="form-control withall"
                            Width="99%" OnRowCommand="GV_RowCommand">
                            <Columns>
                                <asp:TemplateField HeaderText="Nhân viên" ItemStyle-HorizontalAlign="Left" ItemStyle-CssClass="padding">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lbSua" Style="color: #000066;" runat="server" Text='<%#Eval("HoTen") %>'
                                            CommandArgument='<%#Eval("IDs")%>' CommandName="Select" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="SoNgayNghi" ItemStyle-CssClass="padding" HeaderText="Số ngày nghỉ"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="TuNgay" HeaderText="Từ ngày" ItemStyle-CssClass="padding"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="DenNgay" HeaderText="Đến ngày" ItemStyle-CssClass="padding"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="KetLuan" ItemStyle-CssClass="padding" HeaderText="Ý kiến cấp trên"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="TrangThai" HeaderText="Trạng thái" ItemStyle-CssClass="padding"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" Font-Bold="True" HorizontalAlign="Left" />
                            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" Height="30px" />
                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                            <RowStyle BackColor="White" ForeColor="#000066" Height="30px" />
                            <SelectedRowStyle BackColor="Lavender" Font-Bold="false" />
                        </asp:GridView>
                    </div>
                    &nbsp;&nbsp;
                    <asp:RadioButton ID="ck1" runat="server" AutoPostBack="true" Checked="true" GroupName="s"
                        Text="Tất cả" OnCheckedChanged="stt_CheckedChanged" />&nbsp;&nbsp;
                    <asp:RadioButton ID="ck2" runat="server" AutoPostBack="true" GroupName="s" Text="Đã duyệt"
                        OnCheckedChanged="stt_CheckedChanged" />&nbsp;&nbsp;
                    <asp:RadioButton ID="ck3" runat="server" AutoPostBack="true" GroupName="s" Text="Không duyệt"
                        OnCheckedChanged="stt_CheckedChanged" />
                    <asp:RadioButton ID="ck4" runat="server" AutoPostBack="true" GroupName="s" Text="Chờ duyệt"
                        OnCheckedChanged="stt_CheckedChanged" />
                    <asp:HiddenField ID="IDNghiPhep" runat="server" />
                </div>
                <asp:HiddenField ID="hdID" runat="server" />
            </div>
            <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" CancelControlID="btnExit"
                Drag="True" BackgroundCssClass="modalBackground" PopupControlID="pnPopup" TargetControlID="btnDuyet"
                RepositionMode="RepositionOnWindowResize">
            </cc1:ModalPopupExtender>
            <asp:Panel ID="pnPopup" runat="server" Style="display: none; width: 80%;">
                <div style="background-image: url('img/content.png'); background-repeat: repeat;
                    box-shadow: 5px 5px 5px #888; border-radius: 10px; border: 1px solid #6EA1C0;
                    margin-top: -10px;">
                    <div style="background-color: #5B5B5B; color: White; font-weight: bold; border-radius: 5px 5px 0px 0px;
                        width: 100%; text-align: center; line-height: 26px; overflow: hidden;">
                        PHÊ DUYỆT VĂN BẢN
                    </div>
                    <div style="margin: 5px;">
                        <table width="99%">
                            <tr>
                                <td>
                                    Kết luận&nbsp;&nbsp;
                                    <asp:RadioButton runat="server" ID="rdDat" Text="Duyệt" GroupName="duyet" Checked="true" />
                                    <asp:RadioButton runat="server" ID="rdKhongDat" Text="Không duyệt" GroupName="duyet" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Lý do<br />
                                    <asp:TextBox ID="txtNoiDung" runat="server" CssClass="form-control withall" TextMode="MultiLine"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Button ID="btnLuu" runat="server" Style="margin-left: 5px;" Text="Lưu lại" CssClass="btn btn-primary"
                                        OnClick="btnLuu_Click" />
                                    <asp:Button ID="btnExit" runat="server" Text="Hủy bỏ" CssClass="btn btn-warning" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </asp:Panel>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="btnPDF" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
